package com.atguigu.controller;

import com.atguigu.pojo.Order;
import com.atguigu.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

// localhost:10200/api/order/getOrderById/102
@RestController
@RequestMapping("/api/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/getOrderById/{id}")
    public Order getOrderById(@PathVariable Integer id,@RequestHeader(value = "name") String name ) {
        return orderService.getOrderById(id);
    }
}
